package com.yhtech.actions;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport {
	
	private String userName;
	private String password;
	
	public String execute() throws Exception {
		Map session = ActionContext.getContext().getSession();
		
		if(userName != null && password != null && userName.equals(session.get("userName")) && password.equals(session.get("password"))){
			return SUCCESS;
		}
		
		return LOGIN;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
}
